﻿using System;
using System.Collections.Generic;
using Furesoft.Patterns.Interpreter;

namespace InterpreterExample
{
    class Program
    {
        static void Main(string[] args)
        {
            Context context = new Context();

            // Usually a tree
            List<IInterpretable> list = new List<IInterpretable>();

            // Populate 'abstract syntax tree'
            list.Add(new TerminalExpression());
            list.Add(new NonterminalExpression());
            list.Add(new TerminalExpression());
            list.Add(new NonterminalExpression());

            foreach (var exp in list)
            {
                exp.Interpret(context);
            }

            Console.ReadKey();
        }
    }
}